/**
  ******************************************************************************
  * @file    sym32l010_hal_systick.h
  * @author  AE Team
  * @version 1.0.3
  * @date    2024-05-28
  * @brief   Header file of SYSTICK HAL module.
  *
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2024 SIYIMicro.
  * All rights reserved.</center></h2>
  *
  *
  ******************************************************************************
  */


/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __SYM32L010_HAL_SYSTICK_H
#define __SYM32L010_HAL_SYSTICK_H

#ifdef __cplusplus
extern "C" {
#endif


/******************************************************************************/
/* Include files                                                              */
/******************************************************************************/
#include "sym32l010_hal_def.h"


/******************************************************************************/
/* Global type definitions                                                    */
/******************************************************************************/
typedef enum
{
  HAL_TICK_FREQ_10HZ         = 100UL,
  HAL_TICK_FREQ_100HZ        = 10UL,
  HAL_TICK_FREQ_1KHZ         = 1UL,
  HAL_TICK_FREQ_DEFAULT      = HAL_TICK_FREQ_1KHZ
} HAL_TickFreqTypeDef;


/******************************************************************************/
/* Global pre-processor symbols/macros ('#define')                            */
/******************************************************************************/
#define TICK_INT_PRIORITY               ((uint32_t)3UL)    /*!< tick interrupt priority (lowest by default)  */

#define HAL_MAX_DELAY                   (0xFFFFFFFFUL)

#define IS_TICKFREQ(FREQ)               (((FREQ) == HAL_TICK_FREQ_10HZ)  || \
                                         ((FREQ) == HAL_TICK_FREQ_100HZ) || \
                                         ((FREQ) == HAL_TICK_FREQ_1KHZ))


/******************************************************************************/
/* Global macro function                                                      */
/******************************************************************************/


/******************************************************************************/
/* Exported variables ('extern', definition in C source)                      */
/******************************************************************************/
extern __IO uint32_t uwTick;
extern uint32_t uwTickPrio;
extern HAL_TickFreqTypeDef uwTickFreq;


/******************************************************************************/
/* Global function prototypes ('extern', definition in C source)              */
/******************************************************************************/
HAL_StatusTypeDef   HAL_InitTick(uint32_t HclkFreq);
void                HAL_Delay(uint32_t Delay);
uint32_t            HAL_GetTick(void);
void                HAL_SuspendTick(void);
void                HAL_ResumeTick(void);
void                HAL_IncTick(void);

#ifdef __cplusplus
}
#endif

#endif /* __SYM32L010_HAL_SYSTICK_H */


/************************ (C) COPYRIGHT SIYIMicro *****END OF FILE*************/
